export const toString = v => Object.prototype.toString.call(v)
export const isObject = v => v && typeof v == 'object'
export const isArray = v => toString(v) == '[object Array]'
export const includes = (arr, v) => arr.includes(v)
export const isFunction = v => typeof v == 'function'
export const isString = v => typeof v == 'string'
export const forEach = (v, fn) => {
  if (isArray(v)) {
    v.forEach(fn)
  } else if (isObject(v)) {
    Object.keys(v).forEach((key, index) => {
      fn(v[key], key, index)
    })
  }
}
